<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>title配置项</title>
  <script src="./echarts.js"></script>
  <style lang="css">
    #chart1 {
      width: 1000px;
      height: 800px;
      border: 1px solid red;
      float: left;
    }
  </style>
</head>
<body>
  <div id="chart1"></div>

  <script>
    const myChart1 = echarts.init(document.getElementById('chart1'));

    myChart1.setOption({
      title: {
        id: 'txt',
        show: true,
        text: '柱状图666',
        link: 'http://www.baidu.com',
        target: 'self',
        textStyle: {
          color: 'black',
          fontSize: 20,
          textBorderColor: 'transparent',
          fontWeight: 'normal'
        },
        subtext: '副标题',
        sublink: 'http://www.baidu.com',
        subtarget: 'self',
        subtextStyle: {
          color: 'red',
          fontSize: 19,
          textBorderColor: 'transparent',
          fontWeight: 'normal'
        },
        textAlign: 'auto', // 文本水平对齐方式
        itemGap: 10,
        left: 0,
        top: 0,
        backgroundColor: '#ccc',
        shadowBlur: 10,
        shadowColor: 'red',
      },
      legend: { // 图例
        data: ['销量']
      },
      xAxis: {
        data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
      },
      yAxis: {},
      series: {
        name: '销量',
        type: 'bar',
        data: [5, 20, 36, 10, 10, 20]
      }
    })
  </script>
</body>
</html>